class CreateRatings < ActiveRecord::Migration
  def self.up
    create_table(:ratings, :options=>"ENGINE=MyISAM") do |t|
      t.integer :drug_id
      t.integer :score
      t.string  :reason
      t.text    :side_effect_text
      t.text    :comment
      t.string  :sex
      t.integer :age
      t.integer :days_taken
      t.integer :times_taken
      t.datetime :date_added
      t.timestamps
    end
    add_index(:ratings, :drug_id)
    add_index(:ratings, [:drug_id, :id])
  end

  def self.down
    drop_table :ratings
  end
end
